{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "09060a3a",
   "metadata": {},
   "source": [
    "---------\n",
    "* 2022/10/10/week07\n",
    "* Python学习记录\n",
    "* 记录人：小紫\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b794b4f6",
   "metadata": {},
   "source": [
    "## 本周学习\n",
    "* 1.有序的数据结构——字符串（str）\n",
    "* 2.有序的数据结构——列表（list）\n",
    "### 1.字符串（string）\n",
    "> 1. 关于字符串的基本内容\n",
    "> 2. 关于字符串的方法与函数\n",
    "#### 1.1关于字符串的基本内容\n",
    "* Single quotes: 'allows embedded \"double\" quotes'\n",
    "\n",
    "* Double quotes: \"allows embedded 'single' quotes\"\n",
    "\n",
    "* Triple quoted: '''Three single quotes''', \"\"\"Three double quotes\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d3560811",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'spam eggs'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'spam eggs'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a9fce4ac",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'str'>\n"
     ]
    }
   ],
   "source": [
    "print(type('spam eggs'))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "335e2d04",
   "metadata": {},
   "source": [
    "> 'doesn't'写法是错误的，应该写'doesn\\'t'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "8a7c8a63",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"doesn't\""
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'doesn\\'t'"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "16efe25c",
   "metadata": {},
   "source": [
    "> 三引号：保留字符串信息的 格式信息,保留完整的数据信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "db7ac1d2",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "EOL while scanning string literal (2251390238.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [4]\u001b[1;36m\u001b[0m\n\u001b[1;33m    \"Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal.\u001b[0m\n\u001b[1;37m                                                                                                                      ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m EOL while scanning string literal\n"
     ]
    }
   ],
   "source": [
    "\"Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal.\n",
    "\n",
    "String literals that are part of a single expression and have only whitespace between them will be implicitly converted to a single string literal. That is\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ebebddee",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal.\n",
      "\n",
      "String literals that are part of a single expression and have only whitespace between them will be implicitly converted to a single string literal. That is\n"
     ]
    }
   ],
   "source": [
    "print('''Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal.\n",
    "\n",
    "String literals that are part of a single expression and have only whitespace between them will be implicitly converted to a single string literal. That is''')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "369fe118",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: thingy [OPTIONS]\n",
      "     -h                        Display this usage message\n",
      "     -H hostname               Hostname to connect to\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(\"\"\"\\\n",
    "Usage: thingy [OPTIONS]\n",
    "     -h                        Display this usage message\n",
    "     -H hostname               Hostname to connect to\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "04bc5bc2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<script type=\"importmap\" nonce=\"\"> { \"imports\": {\"rms-answers-HomepageVNext-PeregrineWidgets\":\"https://assets.msn.com/bundles/v1/bingHomepage/latest/widget-initializer.js\"} } </script>\n"
     ]
    }
   ],
   "source": [
    "print('''<script type=\"importmap\" nonce=\"\"> { \"imports\": {\"rms-answers-HomepageVNext-PeregrineWidgets\":\"https://assets.msn.com/bundles/v1/bingHomepage/latest/widget-initializer.js\"} } </script>''')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f580bc70",
   "metadata": {},
   "source": [
    "#### 1.2关于字符串的方法以及函数"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a2698255",
   "metadata": {},
   "source": [
    "> 1. 字符串是可以拼接的（字符串的运算）,用 + 进行字符串之间的拼接\n",
    "> 2. 字符串是有顺序的,从第一个字符开始，从0依次往后；有长度，可以用len()检查字符串的长度\n",
    "> 3. 字符串的取值：\n",
    ">> 1. 取单个值 :从左往右（正数，第一个值是0），从右往左（负数，第一个值是-1）\n",
    ">> 2. 取多个值 :切片的方法，两个值作为 取值的区间\n",
    "> 4. 字符串的方法及函数\n",
    ">> 1. in 查询成员是否存在\n",
    ">> 2. str.count() 查询数量\n",
    ">> 3. str.isdigit() 判断字符串是否是 数字"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "e03a3958",
   "metadata": {},
   "outputs": [],
   "source": [
    "new_name = [\"小明\",\"小红\",\"张杰\",\"李华\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "bcdcd0cd",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "广州南方学院团委欢迎小明\n",
      "广州南方学院团委欢迎小红\n",
      "广州南方学院团委欢迎张杰\n",
      "广州南方学院团委欢迎李华\n"
     ]
    }
   ],
   "source": [
    "for i in new_name:\n",
    "    print(\"广州南方学院团委欢迎\"+i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "ea9e5bb5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'广州南方学院团委欢迎小明'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"广州南方学院团委欢迎\"+\"小明\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "575c8a00",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'广州南方学院团委欢迎小明'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "text = '广州南方学院团委欢迎小明'\n",
    "text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d6722a95",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'广'"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "text[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "ebfa858a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'州'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "text[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "82e90ead",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'南'"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "text[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "f9f0d853",
   "metadata": {},
   "outputs": [
    {
     "ename": "IndexError",
     "evalue": "string index out of range",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mIndexError\u001b[0m                                Traceback (most recent call last)",
      "Input \u001b[1;32mIn [14]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mtext\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m12\u001b[39;49m\u001b[43m]\u001b[49m\n",
      "\u001b[1;31mIndexError\u001b[0m: string index out of range"
     ]
    }
   ],
   "source": [
    "text[12]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "c106ff86",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "12"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "ede427b9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'团委'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "text[6]+text[7]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "b5cb7f23",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'团委'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "text[6:8]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "71c2efb0",
   "metadata": {},
   "source": [
    "* in查询成员"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "abaf3cfc",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'广州' in text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "d5584104",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'北京' in text"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "afd9d8d8",
   "metadata": {},
   "source": [
    "* str.count() 查询数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "3cff747f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "text.count('广州')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1117734d",
   "metadata": {},
   "source": [
    "* str.isdigit() 判断字符串是否是 数字"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "d0b12ddf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "19\n",
      "19\n"
     ]
    }
   ],
   "source": [
    "print(19)\n",
    "print('19')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "62536342",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "19 <class 'int'>\n",
      "19 <class 'str'>\n"
     ]
    }
   ],
   "source": [
    "print(19,type(19))\n",
    "print('19',type('19'))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0203112e",
   "metadata": {},
   "source": [
    "> 这就是数值问题,都是19但是类型不同\n",
    "\n",
    "> isdigit可以判断数据类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "17cd4fc7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "19 <class 'int'>\n",
      "19 <class 'str'>\n"
     ]
    }
   ],
   "source": [
    "age_li = 19\n",
    "age_wang = '19'\n",
    "print(age_li,type(age_li))\n",
    "print(age_wang,type(age_wang))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "62b4d78c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "age_wang.isdigit()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "7840258a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "text.isdigit()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5ddbfb53",
   "metadata": {},
   "source": [
    "## 2.有序的数据结构——列表（list）\n",
    "* Python knows a number of compound data types, used to group together other values. The most versatile is the list, which can be written as a list of comma-separated values (items) between square brackets. Lists might contain items of different types, but usually the items all have the same type.\n",
    "> 1. 列表的基本运算法则（参考：有序的数据结构的运算法则列表）\n",
    "> 2. 列表的一般方法（要求：全部掌握，并且做总结在课后笔记中）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "df956d75",
   "metadata": {},
   "source": [
    "### 2.1列表的基本运算法则"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a0e00ade",
   "metadata": {},
   "source": [
    "* 思考：假设，有这样一个场景，我要录入/存放一个班的同学的信息（名单信息），用字符串存放是否可行？"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a10016f3",
   "metadata": {},
   "source": [
    "> 字符串存放"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f7eaee25",
   "metadata": {},
   "outputs": [],
   "source": [
    "网二_name = \"李华，小明，李晓华，小红\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "70ec32ef",
   "metadata": {},
   "source": [
    "> 字符串取值（比较麻烦）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "ceac956e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'李华'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网二_name[0:2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "d2f93862",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'小明'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网二_name[3:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "1a553349",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'李晓华'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网二_name[6:9]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "181404cc",
   "metadata": {},
   "source": [
    "> 用列表存放，注意逗号需要用英文来打(列表是有序的0，1，2，3......)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7bad8771",
   "metadata": {},
   "source": [
    "* 对比字符串和列表\n",
    "> 1. 字符串是按照字符进行数据取值\n",
    "> 2. 列表是按照元素进行数据取值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "4acb5782",
   "metadata": {},
   "outputs": [],
   "source": [
    "网二_name_list = [\"李华\",\"小明\",\"李晓华\",\"小红\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ecec0b5a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(网二_name_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "518c810e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'李华'"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网二_name_list[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "4fa87252",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['李晓华', '小红']"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网二_name_list[-2:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "bb22cb93",
   "metadata": {},
   "outputs": [],
   "source": [
    "网二_age_list = [19,18,19,20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "1b94fb85",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "19"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网二_age_list[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "05646768",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[19, 18, 19, 20]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网二_age_list[:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "77e06a0d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网二_age_list.count(19)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ef5900ed",
   "metadata": {},
   "source": [
    "### 2.2列表的方法\n",
    "\n",
    "> 1. 增加\n",
    "> 2. 删除\n",
    "> 3. 修改\n",
    "> 4. 查询in,count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "b19db706",
   "metadata": {},
   "outputs": [],
   "source": [
    "names = [\"Mike\",\"Marry\",\"Jan\",\"Jack\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6ab0aeff",
   "metadata": {},
  "source": [
    "* 学习方法\n",
    "> 1. listname.Tab键 查看所有方法名称\n",
    "> 2. help(listnames.function)查看其中一个方法的具体操作内容\n",
    "\n",
    "> 课后练习（做一个表格，总结列表的方法）: \n",
    "\n",
    "| 列表方法        |      Description       |       备注\n",
    "|------------------- |------------------------------|------------------------\n",
    "|  append()       |增加元素，增加在列表的末尾   |\n",
    "|  count()        |统计某个元素在列表中出现的次数|               \n",
    "| extend()        |在列表末尾一次性追加另一个序列中的多个值（用新列表拓展原来的列表）\n",
    "| index()         |从列表中找出某个值第一个匹配项的索引个位置                             \n",
    "| insert()        |     将对象插入列表                                        \n",
    "|pop()           |移除列表中的一个元素（默认最后一个元素），并返回该元素的值\n",
    "|   remove()       |     移除列表中某个值的第一个匹配项                                      \n",
    "|    reverse()      |    反向列表中元素                                      \n",
    "|     sort()      |        对原列表进行排序   \n",
    "|clear()           |  清空列表\n",
    "|copy()          |复制列表\n",
    "|\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "9cfa8bdb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function append:\n",
      "\n",
      "append(object, /) method of builtins.list instance\n",
      "    Append object to the end of the list.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(names.append)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3b8a8a02",
   "metadata": {},
   "source": [
    "> 用（）括起来的，都叫做函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "de70fbc2",
   "metadata": {},
   "outputs": [],
   "source": [
    "names.append(\"purple\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "d3add4a6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Mike', 'Marry', 'Jan', 'Jack', 'purple']"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "names"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "7ed5d601",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function insert:\n",
      "\n",
      "insert(index, object, /) method of builtins.list instance\n",
      "    Insert object before index.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(names.insert)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "1fd4846b",
   "metadata": {},
   "outputs": [],
   "source": [
    "names.insert(1,\"Alex\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "a533d1e0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Mike', 'Alex', 'Marry', 'Jan', 'Jack', 'purple']"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "names"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ccae25f7",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
